<% layout('/layouts/default.html', {title: '任务扣分表管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">

		<div class="box-body">
			<#form:form id="searchForm" model="${dcSupTaskScore}" action="${ctx}/dceconomicindicator/dcSupTaskScore/listData" method="post" class="form-inline "
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
			<div style="float:right">

				<div class="form-group">
					<label class="control-label">${text('统计年份')}：</label>
					<div class="control-inline width-120">
						<#form:select path="taskYear" items="${yearList}" blankOption="true" data-placeholder="请选择" itemLabel="yearLabel" itemValue="yearValue" class="form-control width-120" defaultValue="${currentYear}"/>
					</div>
				</div>
				<div class="form-group" id="creatUnitDiv">
					<label class="control-label">${text('任务发布单位')}：</label>
					<div class="control-inline" style="min-width: 220px">
						<#form:select path="createUnit" style="min-width: 120px" items="${createUnitList}" blankOption="true" data-placeholder="请选择" itemLabel="createUnitName" itemValue="createUnit" class="form-control width-220"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('牵头单位')}：</label>
					<div class="control-inline">
						<#form:input path="leaderOrgName" maxlength="100" class="form-control width-120"/>
					</div>
				</div>

				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm" onclick="cz()">${text('重置')}</button>
				</div>
			</div>
		</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
	 var echart ='${dcSupTaskScore.echart}'
	 if(echart=="1"){
	 	$("#creatUnitDiv").hide()
	 }
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text("牵头单位")}', name:'leaderOrgName', index:'a.leader_org_name', width:200, align:"left"},
		{header:'${text("被扣分")}', name:'score', index:'a.score', width:150, align:"center"},
		{header:'${text("扣分原因")}', name:'scoreReason', index:'a.score_reason', width:200, align:"left"
			, formatter: function(val, obj, row, act){
				var createUnit = $("#createUnit").val()
				var taskYear = $("#taskYear").val()
			return '<a href="${ctx}/dceconomicindicator/dcSupTaskScore/listDes?leaderOrgCode='+row.leaderOrgCode+'&createUnit='+createUnit+'&taskYear='+taskYear+'" class="btnList" >'+(val||'暂无标题')+'</a>';}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
function cz(){
	searchForm.reset();
	$('#dataGrid').dataGrid('reloadGrid');
}

</script>